package com.ymttest.database.mapping;

import java.util.Map;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.ymttest.database.model.*;

public interface JUserMapper {
	Userinfo selectUserinfoByUid(Map m);
	@Select("select * from userinfo where userid=24636166")
	Userinfo select1KSeller(Map m);
	Userinfoex selectUserinfoexByUid(Map m);
	int deleteUserinfoexByUid(Map m);
	int deleteUserinfoByUid(Map m);
	
	int deleteUserinfoByEmail(Map m);
	
	ThirdpartyUserbind selectthirdpartyuserbind(Map m);
	ThirdpartyUserbindHistory selectthirdpartyuserbindhistory(Map m);
	
	Userinfo selectTop1Userinfo();

	int setOpenIdOfThirdPartyUserBind(Map m);

	int removeMoblie(Integer uid);
	ThirdpartyUserbind selectWXUser();
	@Select("<script>select * from UserAddress where userid=#{uid} "
			+ "<if test=\"EncryptedDetailAddress!=null and EncryptedDetailAddress!=''\">"
					+ "  and EncryptedDetailAddress=#{EncryptedDetailAddress}"
		   + " </if>"
		   + "</script>")
	UserAddress selectAddress(Map m);
	int updateLoginId(Map m);
	Map selectWxUserMapping(Map m);
	int updateUserState(Map m);
	UserinfoUpdaterecord selectUserinfoUpdaterecord(Map m);
	@Update("update userinfo_updaterecord set LastUpdateTime=#{ltime}, CreateTime=#{ltime} where userid= #{userid}" )
	int updateUserinfoUpdaterecordTime(Map m);
	
	@Update("update thirdparty_userbind_history set LastUpdateTime=#{ltime}, CreateTime=#{ltime} where userid= #{userid}" )
	int updateThirdpartyUserbindHistoryTime(Map m);
	LoginLog selectLastLoginLogByLoginId(Map m);
	LoginLog selectLastLoginLogByUid(Map m);
	Map selectUsermark(Map m);
	@Update("update userinfo set EncryptedLoginMobile=null where userid= #{userid}" )
	int updateNoMoblie(Map m);
	@Update("update userinfo set RegisterTime=#{regtime} where userid= #{userid}" )
	int updateRegtime(Map m);
	@Select("select * from userinfo where loginid=#{loginid}")
	Userinfo select1UserinfoByLoginid(String loginid);
}